import request from "../utils/request";

// 获取产品列表数据

export function getProList (params) {
  return request({
    url: '/pro/list',
    method: "GET",
    data: params
  })
}

// 获取产品分类数据
export function getCategoryList () {
  return request({
    url: '/pro/getCategory',
    method: "GET"
  })
}

// 筛选商品 category search
export function getSearchList (params) {
  return request({
    url: '/pro/searchPro',
    method: "POST",
    data: params
  })
}

// 修改商品是否 售卖 推荐 秒杀
export function updateFlag (params) {
  return request({
    url: '/pro/updateFlag',
    method: "POST",
    data: params
  })
}

// 获取秒杀或者推荐的列表
export function getSeckillData () {
  return request({
    url: '/pro/showdata',
    method: "POST",
    data: {
      type: 'isseckill',
      flag: 1
    }
  })
}

// 获取推荐数据
export function getRecommendData () {
  return request({
    url: '/pro/showdata',
    method: "POST",
    data: {
      type: 'isrecommend',
      flag: 1
    }
  })
}

// 获取产品详情
export function getProDetail (params) {
  return request({
    url: '/pro/showdata',
    method: "GET",
    data: params
  })
}